﻿<UserControl x:Class="SMIL.Client.WPXAP.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"
    xmlns:n="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.NavigationPanel"
    xmlns:l="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.Logo"
    xmlns:mm="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.MiniMap"
    xmlns:fp="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.FloatingPanel"
    xmlns:ps="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.PersistedState"
    xmlns:smilLP="clr-namespace:SMIL.Client.WPXAP.LayerPanel;assembly=SMIL.Client.WPXAP.LayerPanel"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">  

    <UserControl.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/DeepEarth.BingMapsToolkit.Client.Common;component/Resources/CommonStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <Style x:Key="BaseLayersListBox" TargetType="ListBox">
                <Setter Property="Margin" Value="1" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBox">
                            <Grid>
                                <ItemsPresenter />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <ItemsPanelTemplate x:Key="ItemsPanelTemplate">
                <StackPanel/>
            </ItemsPanelTemplate>

        </ResourceDictionary>

    </UserControl.Resources>

        <Grid x:Name="LayoutRoot" Background="Black">
        <m:Map x:Name="map" ScaleVisibility="Collapsed" NavigationVisibility="Collapsed"  />
        <ps:PersistedState MapName="map" />

            <n:NavigationPanel x:Name="navpanel" MapName="map" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="8,8,8,8" Width="250" Height="50" >
                <StackPanel Orientation="Horizontal">
                <Button x:Name="ButtonFullScreen" Click="ButtonFullScreen_Click" Margin="4" Style="{StaticResource ButtonStyle}">
                    <Button.Content>
                        <Image Source="images/FullScreen.png" ToolTipService.ToolTip="Full Screen" />
                    </Button.Content>
                </Button>
                    <Button x:Name="ButtonSMILLayers" Click="ButtonSMILLayers_Click" Content="SMIL Layers" Margin="4" Style="{StaticResource ButtonStyle}"/>
                </StackPanel>
            </n:NavigationPanel>

        <l:Logo HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="50,5,5,5" />

        <!--<fp:FloatingPanel x:Name="fpMiniMap" Opacity="0.9">            
            <mm:MiniMap MapName="map" />
        </fp:FloatingPanel>-->
                
            <fp:FloatingPanel x:Name="fpLayerPanel" Opacity="0.9" HorizontalAlignment="Right" VerticalAlignment="Top">
                <smilLP:LayerPanel x:Name="layerPanel" MapName="map" >
                    <StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="images/smilLogo-small.JPG" />
                            <TextBlock Text="SMIL Layers" FontSize="16" Foreground="White" Margin="10,4,4,4" ></TextBlock>    
                        </StackPanel>
                        
                        <ListBox x:Name="BaseLayers" Style="{StaticResource BaseLayersListBox}" 
                                        ItemContainerStyle="{StaticResource ListBoxItemStyle}" 
                                        ItemsPanel="{StaticResource ItemsPanelTemplate}"></ListBox>
                    </StackPanel>
                </smilLP:LayerPanel>
            </fp:FloatingPanel>

        </Grid>
</UserControl>
